import React, {Component} from "react";
import {ScrollView, StyleSheet} from "react-native";
import {List} from '@ant-design/react-native';
import CharListItem from '../components/CharListItem';

const img = {uri: 'https://facebook.github.io/react-native/docs/assets/favicon.png'}
const msg = '你好'
const title = '联系人'
const date = '上午 10：27'

export default class ChatList extends Component {
    render() {
        return (
            <ScrollView
                style={styles.container}>
                <List>
                    <CharListItem img={img} msg={msg} title={title} date={date} navigation={this.props.navigation}/>
                    <CharListItem img={img} msg={msg} title={title} date={date} navigation={this.props.navigation}/>
                    <CharListItem img={img} msg={msg} title={title} date={date} navigation={this.props.navigation}/>
                    <CharListItem img={img} msg={msg} title={title} date={date} navigation={this.props.navigation}/>
                    <CharListItem img={img} msg={msg} title={title} date={date} navigation={this.props.navigation}/>
                    <CharListItem img={img} msg={msg} title={title} date={date} navigation={this.props.navigation}/>
                    <CharListItem img={img} msg={msg} title={title} date={date} navigation={this.props.navigation}/>
                    <CharListItem img={img} msg={msg} title={title} date={date} navigation={this.props.navigation}/>
                    <CharListItem img={img} msg={msg} title={title} date={date} navigation={this.props.navigation}/>
                    <CharListItem img={img} msg={msg} title={title} date={date} navigation={this.props.navigation}/>
                    <CharListItem img={img} msg={msg} title={title} date={date} navigation={this.props.navigation}/>
                    <CharListItem img={img} msg={msg} title={title} date={date} navigation={this.props.navigation}/>
                    <CharListItem img={img} msg={msg} title={title} date={date} navigation={this.props.navigation}/>
                    <CharListItem img={img} msg={msg} title={title} date={date} navigation={this.props.navigation}/>
                </List>
            </ScrollView>
        );
    }
}

const styles = StyleSheet.create({
    container: {
        flex: 1,
        backgroundColor: '#f5f5f9'
    },
    section: {
        flex: 1,
        backgroundColor: "gray",
        justifyContent: "center",
        alignItems: "center"
    },
    row: {
        flex: 1,
        justifyContent: "center",
        alignItems: "center"
    },
    line: {
        position: "absolute",
        left: 0,
        right: 0,
        bottom: 0,
        height: 1,
        backgroundColor: "#EEE"
    }
});
